﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EDiamondModel;

public partial class Admin_BaiViet : System.Web.UI.Page
{
    EDiamondEntities1 db = new EDiamondEntities1();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            
        }
    }

    protected void GridBaiViet_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Sua")
        {
            int id = Convert.ToInt32(e.CommandArgument);
            Response.Redirect("~/Admin/ThemBaiViet.aspx?IDBV=" + id);
        }
    }
    protected void GridBaiViet_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            ImageButton nut = (ImageButton)e.Row.Cells[5].Controls[0];
            if (nut != null)
            {
                nut.CommandArgument = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "BaiVietID"));
                nut.ToolTip = "Sua bai viet";
            }
        }
    }
    protected void GridBaiViet_RowCreated(object sender, GridViewRowEventArgs e)
    {

    }
}